package com.cowin.sys.dao;

import com.cowin.base.Mapper;
import com.cowin.inf.model.vo.WorkMonitorShopVo;
import com.cowin.sys.model.TmBasLine;
import com.cowin.sys.model.TmBasWorkshop;
import com.cowin.sys.model.vo.IdNameVo;
import com.cowin.sys.model.vo.LineVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TmBasWorkshopMapper extends Mapper<TmBasWorkshop> {

    /**
     * 功能描述: 根据WORKSHOP_TYPE 查询产线信息<br>
     *
     * @param type
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/10/30 15:37
     */
    @Select("SELECT TM_BAS_LINE.LINE_NO lineNo, TM_BAS_LINE.LINE_NAME_C name FROM TM_BAS_WORKSHOP left join TM_BAS_LINE on TM_BAS_WORKSHOP.TM_BAS_WORKSHOP_ID = TM_BAS_LINE.TM_BAS_WORKSHOP_ID where TM_BAS_WORKSHOP.WORKSHOP_TYPE= #{type}")
    List<LineVo> findLineInfoByType(String type);

    /**
     * 功能描述: 根据车间 查询车间下的产线<br>
     *
     * @param id 车间id
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2019/11/19 9:58
     */
    @Select("SELECT * FROM TM_BAS_LINE where TM_BAS_WORKSHOP_ID = #{id}")
    List<TmBasLine> getLineById(Long id);


    /**
     * 功能描述: 生产线监控 获取车间 产线信息<br>
     *
     * @param
     * @return:
     * @since: 1.0.0
     * @Author:yuchao
     * @Date: 2020/1/13 11:16
     */
    List<WorkMonitorShopVo> getWorkShopMonitorInfo();
}